//设置操作权限
var fnSetFunctionRight = function () {
    //debugger
    var recordID = myDataTable.getSelectedRows()[0];
    record = myDataTable.getRecord(recordID);
    pId = record.getData(const_entityID);
    conditonId = "UserID";
    selectId = "RoleID";
    document.getElementById("EditUIWindow").src = "../EditWidows/YUITree.aspx?masterentity=SysRoleFunction&masterPara=SysFunction|Name|FunctionID|ParentID|FunctionPath|True";

    var _btn = document.getElementById("yui-gen7-button"); if (_btn != null && _btn != undefined) {        _btn.style.display = "";}
    SetMaxDWH(YAHOO.example.container.dialog1);
    YAHOO.example.container.dialog1.show();
    //SetMaxDWH(YAHOO.example.container.dialog1);
}

var fnViewUser = function () {
    var recordID = myDataTable.getSelectedRows()[0];
    record = myDataTable.getRecord(recordID);
    var RoleID = record.getData(const_entityID);
    //conditonId = "UserID";
    var selectId = "RoleID";
    var condition = "RoleID='" + RoleID + "'";
    var _btn = document.getElementById("yui-gen7-button");
    if (_btn != null && _btn != undefined) {
        _btn.style.display = "none";
    }
    document.getElementById("EditUIWindow").src = "/Extend/ViewList.aspx?isShonwBtn=Y&roleid="+RoleID+"&entity=V_UserRole&condition=" + condition;
    var _btn = document.getElementById("yui-gen7-button"); if (_btn != null && _btn != undefined) { _btn.style.display = "none"; }
    
    YAHOO.example.container.dialog1.show();
}
//
var fnSetRolePosts = function () {
    var recordID = myDataTable.getSelectedRows()[0];
    record = myDataTable.getRecord(recordID);
    var RoleID = record.getData(const_entityID);
    //conditonId = "UserID";
    var selectId = "RoleID";
    var condition = "RoleID='" + RoleID + "'";
    var _btn = document.getElementById("yui-gen7-button");
    if (_btn != null && _btn != undefined) {
        _btn.style.display = "none";
    }
    document.getElementById("EditUIWindow").src = "/Extend/ViewList.aspx?isShonwBtn=Y&roleid=" + RoleID + "&entity=V_PostRole&condition=" + condition;
    document.getElementById("yui-gen7-button").style.display = "none";
    document.getElementById("dialog1_h").innerHTML = "设置角色对应岗位";
    YAHOO.example.container.dialog1.show();
}
//设置功能权限
var fnSetOperationRight = function () {
    var recs = this.mDataTable.getRecordSet();
    var recordID = myDataTable.getSelectedRows()[0];
    record = myDataTable.getRecord(recordID);
    document.getElementById("EditUIWindow").src = "RightSeting.aspx?r=" + Math.random() + "&entity=V_FunctionRight&order=FunctionPath&condition=RoleID='" + record.getData(const_entityID) + "'";
    SetMaxDWH(YAHOO.example.container.dialog1);
    var _btn = document.getElementById("yui-gen7-button"); if (_btn != null && _btn != undefined) {        _btn.style.display = "";}
    YAHOO.example.container.dialog1.show();
}

//设置桌面项
//    var fnSetDeskTopItem = function () {
//    //debugger
//        var recordID = mDataTable.getSelectedRows()[0];
//        var records = mDataTable.getRecord(recordID)
//        document.getElementById("EditUIWindow").src = "../EditWidows/SubjectList.aspx?r=" + Math.random() + "&entity=Set_DesktopItem" + "&id=" + records.getData(const_entityID) + "&condition=RoleID='" + records.getData(const_entityID) + "'";
//        YAHOO.example.container.dialog1.show();
//    }
//设置桌面项
var fnSetDeskTopItem = function () {
    var recordID = mDataTable.getSelectedRows()[0];
    var records = mDataTable.getRecord(recordID)
    //document.getElementById("EditUIWindow").src = "../DeskTop/SetDesktop/SetDesktopItem.aspx?r=" + Math.random() + "&entity=Set_DesktopItem" + "&RoleID=" + records.getData(const_entityID);

    //var url = "../DeskTop/SetDesktop/SetDesktopItem.aspx?r=" + Math.random() + "&entity=Set_DesktopItem" + "&RoleID=" + records.getData(const_entityID);
    var url = "../DeskTop/Form/DesktopConfigForAdmin.aspx?r=" + Math.random() + "&entity=Set_DesktopItem" + "&RoleID=" + records.getData(const_entityID);
    parent.addTabs("桌面配置", url);
    //    SetMaxDWH(YAHOO.example.container.dialog1);
    //    document.getElementById("yui-gen7-button").style.display = "none";
    //    YAHOO.example.container.dialog1.show();
}

//设置课程权限
var fnSetProductLayout = function () {
    var recordID = mDataTable.getSelectedRows()[0];
    var records = mDataTable.getRecord(recordID)
    document.getElementById("EditUIWindow").src = "../Crm/SetProductLayout.aspx";
    SetMaxDWH(YAHOO.example.container.dialog1);
    YAHOO.example.container.dialog1.show();
}